if bkgnd field "Print" is empty then put false into bkgnd field "Print"
put number of this card - the number of first card of this bkgnd + 1 into field "Number"
setPrintButton
get item 1 to 2 of rect of bkgnd field "Pay to"
click at it
tabKey
end openCard
on closeField
put true into bkgnd field "Print"
send setPrintButton
end closeField
on setPrintButton
set hilite of bkgnd button "Print" to bkgnd field "Print"
end setPrintButton
-- TextAmount -- returns text version of numeric dollars and cents
-- amount.
function textAmount amount
put char (number of chars in amount) - 2 to (number of chars in amount) of amount into cents
get trunc(amount)
if it is 0 then get "zero "
else
put it mod 100 into units
put it div 100 into hundreds
get empty
if hundreds is not zero then
if hundreds mod 10 is zero then get text100(hundreds div 10) && "thousand "
else get text100(hundreds) && "hundred "
end if
if units is not zero then put text100(units) & space after it
end if
put "and " & cents & "*****************************************************************" after it
put toUpper(first char of it) into first char of it
return it
end textAmount
-- text100 -- Utility function for textAmount.
function text100 n
put "one two three four five six seven eight nine ten" && "eleven twelve thirteen fourteen fifteen sixteen seventeen" && "eighteen nineteen" into digits
-- handle number less than 20
if n < 20 then
if n = 0 then get "zero"
else get word n of digits
else
-- handle larger numbers
put n mod 10 into units -- separate units and tens
put n div 10 into tens
get word tens of "ten twenty thirty forty fifty sixty seventy eighty ninety"
if units <> 0 then put "-" & word units of digits after it
end if
return it
end text100
-- toUpper -- Convert a lower case letter to upper case.
function toUpper a
return numToChar(charToNum(a) - 32)
end toUpper
-- part 5 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=281 top=105 right=122 bottom=348
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Date
-- part 6 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=360 top=105 right=122 bottom=384
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Year
-- part 3 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=86 top=145 right=162 bottom=366
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Pay to
----- HyperTalk script -----
on closeField
if last character of background field "Pay to" <> "*" then put "*************************************************************" after background field "Pay to"
pass closeField
end closeField
-- part 2 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=388 top=145 right=162 bottom=468
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 65535
-- font id: 4
-- text size: 12
-- style flags: 256
-- line height: 16
-- part name: Amount
----- HyperTalk script -----
on closeField
repeat while first char of field "amount" is "*"
delete first char of field "amount"
end repeat
if number of chars in field "amount" < 3 then put ".00" after field "amount"
else if char (number of chars in field "amount") - 2 of field "amount" <> "." then put ".00" after field "amount"
put textAmount(field "Amount") into field "Text Amount"
repeat for 9 - (number of chars in field "amount") times
put "*" before field "amount"
end repeat
pass closeField
end closeField
-- part 1 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=38 top=167 right=184 bottom=441
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Text Amount
-- part 4 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=55 top=225 right=242 bottom=224
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 2
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: For
-- part 7 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=7 top=301 right=323 bottom=142
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Back to First Card
----- HyperTalk script -----
on mouseUp
visual effect barn door close
go first card
end mouseUp
-- part 8 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=174 top=298 right=327 bottom=211
-- title width / last selected line: 0
-- icon id / first selected line: 9301 / 9301
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseUp
visual effect scroll right
go to previous card of this bkgnd
end mouseUp
-- part 9 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=276 top=298 right=327 bottom=312
-- title width / last selected line: 0
-- icon id / first selected line: 27009 / 27009
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
visual effect scroll left
go to next card of this bkgnd
end mouseUp
-- part 11 (button)
-- low flags: 00
-- high flags: 2004
-- rect: left=13 top=33 right=68 bottom=54
-- title width / last selected line: 0
-- icon id / first selected line: 20689 / 20689
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Home
----- HyperTalk script -----
on mouseUp
visual effect iris close
go home
end mouseUp
-- part 13 (button)
-- low flags: 00
-- high flags: E005
-- rect: left=420 top=88 right=110 bottom=477
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Print
----- HyperTalk script -----
on mouseUp
put hilite of background button "Print" into background field "Print"
end mouseUp
-- part 14 (field)
-- low flags: 81
-- high flags: 0000
-- rect: left=426 top=91 right=109 bottom=467
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Print
-- part 15 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=307 top=48 right=70 bottom=439
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Put today's date
----- HyperTalk script -----
on mouseUp
get item 2 of the abbrev date
delete first char of it
put it into field "Date"
put char 3 to 4 of word 4 of the abbrev date into field "Year"